Skip to content

[REFACTOR][TVMScript] Simplify annotation symbol capture - #20442

Closed
tqchen wants to merge 16 commits into
apache:mainfrom
tqchen:script/annotation-symbol-capture
Closed

tqchen wants to merge 16 commits into
apache:mainfrom
tqchen:script/annotation-symbol-capture

Conversation

@tqchen

@tqchen tqchen commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Depends on #20438.

Read explicit annotation symbols directly instead of wrapping each name in require_defined and annotation_value_. Snapshot the free definition bindings once, preserving lazy missing-name errors and separation from parameter and body scopes.

Remove captured runtime typing.TypeVar adaptation. Local generic symbols use PEP 695 headers with deferred whole annotations; external symbols use concrete I.dynamic/T.dynamic values. Keep annotation classes, Python unions, and deferred return-constructor normalization.

Bind a scalar parameter to an existing native symbol explicitly with n: n. An independently typed parameter such as n: T.int32 shadows an outer symbol without an annotation-read registration side effect. Ordinary body locals may shadow definition captures; explicit header declarations retain symbolic reassignment diagnostics.

Global-info selectors use the builder resolver decorator after ordinary argument evaluation. Remove the obsolete parser argument-policy registry while retaining deferred whole annotations and concrete symbolic dimensions. The S-TIR namespace shares scalar annotation metadata and concrete dynamic constructors with TIRx.

@tqchen
tqchen force-pushed the script/annotation-symbol-capture branch 2 times, most recently from 34f6b17 to b681f6e Compare September 25, 2026 00:36
Share scope-independent dynamic symbol construction between I and T, and replace implicit body declarations with explicit captures or typed function parameters. Preserve dtype information in scalar annotations and print symbols without reconstructing them from body assignments.
Remove expression-string policies and implicit symbolic lookup from the parser and eager constructors. Keep whole annotation decoding and generic annotation adaptation, and print concrete expressions with explicit dynamic symbols.
Declare symbolic dimensions and strides explicitly in script callers, intrinsic factories, and examples. Keep independent function symbols distinct and preserve shared captures and deferred whole annotations.
@tqchen

tqchen commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

Closing task as superseded: Combined into #20447, which includes the final annotation capture changes and retained validation evidence.

Final PR: #20442

@tqchen tqchen closed this Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants